package com.zhrj.exam.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhrj.exam.entity.Pagination;
import com.zhrj.exam.entity.ZhrjAlarmInfo;
import com.zhrj.exam.entity.ZhrjAlarmInfoVo;
import com.zhrj.exam.mapper.ZhrjAlarmInfoMapper;
import com.zhrj.exam.service.IZhrjAlarmInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 事件表 服务实现类
 * </p>
 *
 * @author zhrj
 * @since 2023-03-14
 */
@Service
public class ZhrjAlarmInfoServiceImpl extends ServiceImpl<ZhrjAlarmInfoMapper, ZhrjAlarmInfo> implements IZhrjAlarmInfoService {


    @Autowired
    private ZhrjAlarmInfoMapper userMapper;
    /*** 获取用户信息（QueryWrapper查询分页）** @param pagination 查询条件* @return*/
    public Page<ZhrjAlarmInfo> getUserListByQueryWrapperPage(Pagination pagination,String eventReasons) {
        QueryWrapper<ZhrjAlarmInfo> queryWrapper = new QueryWrapper<>();
        queryWrapper.like("event_reasons",eventReasons);
        Page<ZhrjAlarmInfo> page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize());
        return this.page(page, queryWrapper);
    }
    @Override
    public Page<ZhrjAlarmInfoVo> getUserListBySQLPage(Pagination pagination) {
        Page<ZhrjAlarmInfoVo> page = new Page<>(pagination.getCurrentPage(), pagination.getPageSize());
        return userMapper.getUserListBySQLPage(page);
    }

   public List<ZhrjAlarmInfoVo> getList(String eventReasons) {
       List<ZhrjAlarmInfoVo> list = userMapper.getList(eventReasons);
       return userMapper.getList(eventReasons);
    }

}
